package com.alibaba.csp.sentinel.dashboard.rule.apollo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
/**
 * @ClassName AbstractApolloCommonService
 * @Description TODO
 * @Author zhouchao
 * @Date 2020/2/17 20:05
 * @Version 1.0
 */

@Service
public class AbstractApolloCommonService {

    @Autowired
    protected ApolloCommonService apolloCommonService;
    /**
     * 流控规则前缀标示
     */
    @Value("${flow.key.suffix:-flow}")
    String flowDataIdSuffix;

    /**
     * 熔断降级规则前缀标示
     */
    @Value("${degrade.key.suffix:-degrade}")
    String degradeDataIdSuffix;

    /**
     * 热点规则前缀标示
     */
    @Value("${paramFlow.key.suffix:-paramFlow}")
    String paramFlowDataIdSuffix;

    /**
     * 系统规则前缀标示
     */
    @Value("${system.key.suffix:-system}")
    String systemDataIdSuffix;

    /**
     * 授权规则前缀标示
     */
    @Value("${authority.key.suffix:-authority}")
    String authorityDataIdSuffix;

    /**
     * 限流规则命名空间
     */
    @Value("${apollo.flow.namespace.name:application}")
    String flowSpaceName;
    /**
     * 降级规则命名空间
     */
    @Value("${apollo.degrade.namespace.name:application}")
    String degradeSpaceName;
    /**
     * 热点规则命名空间
     */
    @Value("${apollo.paramFlow.namespace.name:application}")
    String paramFlowSpaceName;
    /**
     * 系统规则命名空间
     */
    @Value("${apollo.system.namespace.name:application}")
    String systemSpaceName;
    /**
     * 认证规则命名空间
     */
    @Value("${apollo.authority.namespace.name:application}")
    String authoritySpaceName;

    @Override
    public String toString() {
        return "AbstractApolloCommonService{" +
                "apolloCommonService=" + apolloCommonService +
                ", flowDataIdSuffix='" + flowDataIdSuffix + '\'' +
                ", degradeDataIdSuffix='" + degradeDataIdSuffix + '\'' +
                ", paramFlowDataIdSuffix='" + paramFlowDataIdSuffix + '\'' +
                ", systemDataIdSuffix='" + systemDataIdSuffix + '\'' +
                ", authorityDataIdSuffix='" + authorityDataIdSuffix + '\'' +
                ", flowSpaceName='" + flowSpaceName + '\'' +
                ", degradeSpaceName='" + degradeSpaceName + '\'' +
                ", paramFlowSpaceName='" + paramFlowSpaceName + '\'' +
                ", systemSpaceName='" + systemSpaceName + '\'' +
                ", authoritySpaceName='" + authoritySpaceName + '\'' +
                '}';
    }
}


















